Pod::Spec.new do |s|
  s.name             = 'OneKit'
  s.version          = '0.2.1'
  s.summary          = 'OneSDK Kit.'
  s.description      = 'a iOS base Framework.'
  s.homepage         = "https://github.com/volcengine/volcengine-specs/tree/master/OneKit"
  s.license          = { :type => 'MIT', :file => 'OneKit/LICENSE' }
  s.author           = { 'chenyi' => 'chenyi.0@bytedance.com' }
  s.source           = { :http => "https://sf3-ttcdn-tos.pstatp.com/obj/volcengine/OneKit/#{s.version}/OneKit.zip" }
  s.ios.deployment_target = '8.0'
  s.requires_arc = true
  s.static_framework = true
  s.pod_target_xcconfig = {
    'DEFINES_MODULE' => 'YES',
  }

  s.subspec 'BaseKit' do |d|
    d.frameworks =  'Foundation'
    d.library = 'z'
    d.source_files = 'OneKit/BaseKit/**/*.h'
    d.public_header_files = 'OneKit/BaseKit/**/*.h'
    d.vendored_library = 'OneKit/BaseKit/**/*.a'
  end

  s.subspec 'Defaults' do |d|
    d.dependency 'OneKit/BaseKit'
    d.frameworks =  'Foundation'
    d.source_files = 'OneKit/Defaults/**/*.h'
    d.public_header_files = 'OneKit/Defaults/**/*.h'
    d.vendored_library = 'OneKit/Defaults/**/*.a'
  end

  s.subspec 'Reachability' do |d|
    d.frameworks =  'Foundation', 'CoreTelephony', 'SystemConfiguration', 'CoreFoundation', 'UIKit'
    d.source_files = 'OneKit/Reachability/**/*.h'
    d.public_header_files = 'OneKit/Reachability/**/*.h'
    d.vendored_library = 'OneKit/Reachability/**/*.a'
  end

  s.subspec 'Service' do |d|
    d.frameworks =  'Foundation'
    d.source_files = 'OneKit/Service/**/*.h'
    d.public_header_files = 'OneKit/Service/**/*.h'
    d.vendored_library = 'OneKit/Service/**/*.a'
  end

  s.subspec 'Database' do |d|
    d.frameworks =  'Foundation'
    d.library = 'sqlite3'
    d.dependency 'OneKit/Service'
    d.source_files = 'OneKit/Database/**/*.h'
    d.public_header_files = 'OneKit/Database/**/*.h'
    d.vendored_library = 'OneKit/Database/**/*.a'
  end

  s.subspec 'StartUp' do |d|
    d.frameworks =  'Foundation'
    d.dependency 'OneKit/BaseKit'
    d.dependency 'OneKit/Reachability'
    d.source_files = 'OneKit/StartUp/**/*.h'
    d.public_header_files = 'OneKit/StartUp/Headers/*.h'
    d.vendored_library = 'OneKit/StartUp/**/*.a'
  end

  s.subspec 'IDFA' do |d|
    d.frameworks =  'AdSupport'
    d.dependency 'OneKit/Service'
    d.dependency 'OneKit/StartUp'
    d.source_files = 'OneKit/IDFA/**/*.h'
    d.public_header_files = 'OneKit/IDFA/**/*.h'
    d.vendored_library = 'OneKit/IDFA/**/*.a'
  end

end
